<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Contains the text description of the last failed SAM operation.</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="samconnection.errno.html">SAMConnection::errno</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="samconnection.isconnected.html">SAMConnection::isConnected</a></div>
 <div class="up"><a href="ref.sam.html">SAM 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="samconnection.error" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SAMConnection::error</h1>
  <p class="verinfo">(PECL sam &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">SAMConnection::error</span> &mdash; <span class="dc-title">Contains the text description of the last failed SAM operation.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-samconnection.error-description">
  <h3 class="title">说明</h3>
  <div class="fieldsynopsis"><span class="type">string</span> <var class="varname">$SAMConnection-&gt;error</var>;</div>

  <p class="para">
   Contains the text description of the last failed SAM operation on this
   connection. If the last operation completed successfully this property
   contains an empty string.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-samconnection.error-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   A string containing the text description of the last error type encountered
   on the connection. An empty string indicates that the last operation on
   this connection completed successfully.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-samconnection.error-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4430">
    <p><strong>Example #1 Using the error number and description properties</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$conn&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SAMConnection</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">(</span><span style="color: #0000BB">SAM_WMQ</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #0000BB">SAM_HOST&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SAM_PORT&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">1506</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$msg&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SAMMessage</span><span style="color: #007700">(</span><span style="color: #DD0000">'This&nbsp;is&nbsp;a&nbsp;simple&nbsp;text&nbsp;item'</span><span style="color: #007700">);<br />if&nbsp;(!</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #DD0000">'topic://test'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;The&nbsp;Send&nbsp;failed!<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"Send&nbsp;failed&nbsp;(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errno</span><span style="color: #DD0000">)&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-samconnection.error-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="samconnection.errno.html" class="xref">SAMConnection::errno</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="samconnection.errno.html">SAMConnection::errno</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="samconnection.isconnected.html">SAMConnection::isConnected</a></div>
 <div class="up"><a href="ref.sam.html">SAM 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
